from rapidocr_paddle import RapidOCR
from PyCmpltrtok.common import sep


if '__main__' == __name__:
    use_cuda = True
    print(f'**** Loading RapidOCR from rapidocr_paddle with cuda = {use_cuda}')
    ocr = RapidOCR(det_use_cuda=use_cuda, cls_use_cuda=use_cuda, rec_use_cuda=use_cuda)

    sep('OCR doing')
    path = '/home/yunpeng/download/fake_contract/newimage2.jpg'
    print(f'path={path}')
    result, _ = ocr(path)
    sep('result')
    print(result)
    sep('_')
    print(_)
    